/*
 * XmlNodeCreater.h
 *
 *  Created on: 2011-3-12
 *      Author: 
 */

#ifndef XMLNODECREATER_H_
#define XMLNODECREATER_H_
#include <e32cmn.h>
#include <e32base.h>
class XmlNodeCreater
{
public:
    static void BuildIntNode( const TDesC& node, int value, TDes& buffer );
    static void BuildFloatNode( const TDesC& node, float value, TDes& buffer );
    static void BuildNormalNode( const TDesC& node, const TDesC& value, TDes& buffer );
    static void BuildEmptyNode( const TDesC& node, TDes& buffer );
    static void BuildTextNode( const TDesC& node, HBufC* value, TDes& buffer );
};

class XmlWriter : public CBase
{
public:
    ~XmlWriter( );
    static XmlWriter* NewL( const TDesC& path );
    static XmlWriter* NewLC( const TDesC& path );
private:
    XmlWriter( );
    void ConstructL( const TDesC& path );
protected:
    HBufC* _path;
    HBufC* _buffer;
public:
    void ClearBuffer();
    void AppendElementNode( const TDesC& element );
    void Write( );
    
protected:
    void Write( const TDesC& content );
protected:
    bool _append;
public:
    HBufC* Read();
};


#endif /* XMLNODECREATER_H_ */
